﻿@using HZT.Framework.Contract
@using HZT.Framework.Web,
@using AD.Contract.Models
@using AD.WebEx
@model  ADAppendix
@{
    Layout = "~/Views/Shared/_Layout.Select.cshtml";
}
@{
    ViewBag.Title = "合同上传";
}
@section PageSpecificStyleSheetIncludes{
    <link href="@Url.StaticFile("~/Content/uploadify/uploadify.css")" rel="stylesheet" />
}
@section PageSpecificJavascriptIncludes{
    <script type="text/javascript" src="@Url.StaticFile("~/assets/js/jquery-1.8.3.min.js")"></script>
    <script type="text/javascript" src="@Url.StaticFile("~/Content/uploadify/jquery.uploadify.min.js")"></script>
    <script type="text/javascript">
        $(function () {
            $('#btn_upload').uploadify({
                uploader: '/ADBill/Upload?Id=' + $("#Id").val(),            // 服务器处理地址
                swf: '/Content/uploadify/uploadify.swf',
                buttonText: "选择合同文件",                  //按钮文字
                height: 34,                             //按钮高度
                width: 82,                              //按钮宽度
                fileTypeExts: "*.jpg;*.png;",           //允许的文件类型
                fileTypeDesc: "请选择图片文件",           //文件说明   
                formData: { "imgType": "normal" }, //提交给服务器端的参数
                onUploadSuccess: function (file, data, response) {   //一个文件上传成功后的响应事件处理
                    var data = $.parseJSON(data);
                    //alert(data.imgpath);
                    if (data.IsSuccess) {
                        alert("上传成功");
                        $("#uploaded").html($("#uploaded").html() + "<br />" + data.orgName);
                    }
                    else
                        alert("上传失败:" + data.Message);
                }
            });
        });

        function getTime(value) {
            var hours = value;
            if (hours < 10) hours = '0' + hours;
            return hours + ':00';
        } 
    </script>
}
@section MainContent{
    <div class="portlet-body form-horizontal form-bordered form-row-stripped">
        <div class="row-fluid">
            <div class="control-group">
                <label class="control-label">
                    合同编号:</label>
                <div class="controls">@Html.HiddenFor(m => m.Id)
                    @Html.HiddenFor(m => m.ADBillId)
                    @ViewData["cId"]
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                </label>
                <div class="controls">
                    <span id="btn_upload"></span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    已上传文件
                </label>
                <div class="controls">
                    <div id="uploaded">
                    </div>
                </div>
            </div>
}
